package com.gui.juc.base.safe;

import lombok.extern.slf4j.Slf4j;

import java.text.SimpleDateFormat;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Slf4j
public class SimpleDateFormatDemo {

    public static void main(String[] args) {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        ExecutorService threadPool = Executors.newFixedThreadPool(5);

        for (int i = 0; i < 100; i++) {
            threadPool.submit(() -> {
                try {
                    log.debug("转换后的日期为：{}", sdf.parse("2024-03-25"));
                }catch (Exception e) {
                    log.error("转换异常", e);
                }
            });
        }

        threadPool.shutdown();

    }
}
